
var window = window || {};

window["webpackJsonp"] = require("../../bundle.js");
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{

/***/ 241:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/* mpx inject */ global.currentModuleId = "mec5654d2"
global.currentResource = "/Users/KK/Documents/Hummer&Tenon/mpx-master/examples/mpx-todoMVC/src/components/app.mpx"
global.currentCtor = Component
global.currentResourceType = 'component'
global.currentCtorType = "component"
global.currentSrcMode = "wx"
/* mpx inject */ global.currentInject = {
  moduleId: "mec5654d2",
  render: function () {
    this._c("mpxShow", this.mpxShow) || this._c("mpxShow", this.mpxShow) === undefined ? '' : 'display:none;';

    this._c("inputVal", this.inputVal);

    ({
      input: [["__model", "inputVal", "__mpx_event__", ["value"], undefined]]
    });
    this._c("todos", this.todos).length === 0;

    this._c("allChecked", this.allChecked);

    this._i(this._c("filteredTodos", this.filteredTodos), function (item, index) {
      item;
      index;
    });

    this._c("todos", this.todos).length === 0;

    this._c("remaining", this.remaining);

    this._i(this._c("filters", this.filters), function (item, index) {
      item;
      this._c("visibility", this.visibility) === item ? 'a selected' : 'a';
      ({
        tap: [["setVisibility", item]]
      });
      item;
    });

    this._c("todos", this.todos).length <= this._c("remaining", this.remaining);

    this._r();
  }
};
/* harmony import */ var _babel_loader_node_modules_mpxjs_webpack_plugin_lib_selector_type_script_index_0_app_mpx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242);
/* empty/unused harmony star reexport */global.currentModuleId
/* script */


/* styles */
__webpack_require__(244)

/* json */
__webpack_require__(245)

/* template */
__webpack_require__(246)


/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(1)))

/***/ }),

/***/ 242:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var babel_runtime_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
/* harmony import */ var babel_runtime_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _mpxjs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
/* harmony import */ var _store_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(243);







var filters = {
  all: function all(todos) {
    return todos;
  },
  active: function active(todos) {
    return todos.filter(function (todo) {
      return !todo.done;
    });
  },
  completed: function completed(todos) {
    return todos.filter(function (todo) {
      return todo.done;
    });
  }
};
Object(_mpxjs_core__WEBPACK_IMPORTED_MODULE_2__["createComponent"])({
  data: {
    visibility: 'all',
    filters: babel_runtime_core_js_object_keys__WEBPACK_IMPORTED_MODULE_1___default()(filters),
    inputVal: ''
  },
  computed: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _store_index__WEBPACK_IMPORTED_MODULE_3__["default"].mapState(['todos']), {
    allChecked: function allChecked() {
      return this.todos.every(function (todo) {
        return todo.done;
      });
    },
    filteredTodos: function filteredTodos() {
      return filters[this.visibility](this.todos);
    },
    remaining: function remaining() {
      return filters.active(this.todos).length;
    }
  }),
  attached: function attached() {
    console.log(this.filteredTodos);
  },

  methods: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
    addTodo: function addTodo() {
      var text = this.inputVal;
      if (text.trim()) {
        _store_index__WEBPACK_IMPORTED_MODULE_3__["default"].commit('addTodo', { text: text });
      }
      this.inputVal = '';
    },
    toggleAll: function toggleAll() {
      _store_index__WEBPACK_IMPORTED_MODULE_3__["default"].commit('toggleAll', { done: !this.allChecked });
    }
  }, _store_index__WEBPACK_IMPORTED_MODULE_3__["default"].mapMutations(['clearCompleted']), {
    setVisibility: function setVisibility(filterName) {
      this.visibility = filterName;
    }
  })
});

/***/ }),

/***/ 244:
/***/ (function(module, exports) {

// removed by extractor

/***/ }),

/***/ 245:
/***/ (function(module, exports) {

// removed by extractor

/***/ }),

/***/ 246:
/***/ (function(module, exports) {

// removed by extractor

/***/ })

},[[241,1]]]);